<extend name="./Public/main" />
<block name="main">
<div class="row J_mainContent" id="content-main" style="overflow-Y:scroll;">
              
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <a href="javascript:;" onclick="addShow(0)"><h5><i class="glyphicon glyphicon-plus" aria-hidden="true"></i>添加顶级菜单</h5></a>
                    </div>
                    <div class="ibox-content">
                        <form method="post" class="form-horizontal" action="{:U('WebConfig/edit')}" enctype ="multipart/form-data">
                            <volist name="webconfig" id="vo" >
	                            <switch name="vo.web_type" >
	                               <case value="1">
		                            <div class="form-group">
		                                <label class="col-sm-2 control-label">{$vo.web_text}</label>
		
		                                <div class="col-sm-10">
		                                    <input type="text" class="form-control"  name="{$vo.web_key}"   value="{$vo.web_value}" style="display:inline-block">
		                                </div>
		                            </div>    
		                            </case>
		                            <case value="3">
		                            <div class="form-group">
		                                <label class="col-sm-2 control-label">{$vo.web_text}</label>
		                                 <script>
											var ue1 = UE.getEditor('{$vo.web_key}');
										</script>
		                                <div class="col-sm-10">
		                                    <script id="{$vo.web_key}" type="text/plain" style="width:1024px;height:250px;" name="{$vo.web_key}">{$vo.web_value|html_entity_decode}</script>
		                                </div>
		                            </div>    
		                            </case>
		                            <case value="2">
			                            <div class="form-group">
			                                <label class="col-sm-2 control-label">{$vo.web_text}</label>
			
			                                <div class="col-sm-10">
			                                    <input type="hidden"  name="{$vo.web_key}" value="{$vo.web_value}">
			                                    <input type="file" name="{$vo.web_key}" style="display:inline-block">
			                                </div>
			                                <img src="{$vo.web_value}" alt="">
			                            </div>    
		                            </case>
		                            <case value="4">
			                            <div class="form-group">
			                                <label class="col-sm-2 control-label">{$vo.web_text}</label>
			
			                                <div class="col-sm-10">
			                                    <textarea name="{$vo.web_key}" id="" cols="150" rows="10">{$vo.web_value|html_entity_decode}</textarea>
			                                </div>
			                                
			                            </div>    
		                            </case>
	                            </switch>
                            </volist>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-2">
                                    <button class="btn btn-primary" type="submit">确定</button>
                                    <button class="btn btn-white" type="submit">取消</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
   
 </div>
  <!-- 添加弹出框开始 -->
        <div id="AddAlert" style="display:none;position:absolute;left:0px;top:0px;z-index:9999;background:rgba(198,198,198,0.5);width:100%;height:100%">
	        <div class="col-sm-6" style="margin-left:470px;margin-top:270px">
	                <div class="ibox float-e-margins">
	                    <div class="ibox-title">
	                        <h5>添加菜单</h5>
	                        <div class="ibox-tools">
	                            <a class="close-link" onclick="addClose()">
	                                <i class="fa fa-times"></i>
	                            </a>
	                        </div>
	                    </div>
	                    <div class="ibox-content">
	                        <div class="row">
	                            <div class="col-sm-12">
	                                <form role="form" action="{:U('WebConfig/add')}" method="post">
	                                    <input type="hidden" name="parent_id">
	                                    <div class="form-group">
	                                        <label>key值</label>
	                                        <input type="text"  name="key" class="form-control">
	                                    </div>
	                                    <div class="form-group">
	                                        <label>value值</label>
	                                        <input type="text"  name="value" class="form-control">
	                                    </div>
	                                    <div class="form-group">
	                                        <label>说明</label>
	                                        <input type="text"  name="text" class="form-control">
	                                    </div>
	                                    <div class="form-group">
	                                        <label>文本框种类</label>
	                                        <select name="type" class="form-control">
	                                            <option value="0">自定义</option>
	                                        	<option value="1">文本框</option>
	                                        	<option value="2">图片框</option>
	                                        	<option value="3">编辑器</option>
	                                        	<option value="4">文本域</option>
	                                        </select>
	                                    </div>
	                                    <div>
	                                        <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="submit" style="margin-right:450px">
	                                           <strong>添加</strong>
	                                        </button>
	                                        
	                                    </div>
	                                </form>
	                            </div>
	                        </div>
	                    </div>
	                </div>
	            </div>
            </div>
        <!-- 添加弹出框结束 -->
        <script>
        function addShow(pid){
        	$("#AddAlert input[name='parent_id']").val(pid);
        	$("#AddAlert").css("display","block");
        }
        function addClose(){
        	$("#AddAlert").css("display","none");
        }
        </script>
</block>